<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('生产原始数据列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>生产订单编号：</label>
                                <input type="text" name="AUFNR" id="AUFNR" style="width: 130px;"/>
                            </li>

                            <li>
                                <label>物料号：</label>
                                <input type="text" name="MATNR" style="width: 130px;"/>
                            </li>
<!--                            <li>-->
<!--                                <label>物料描述：</label>-->
<!--                                <input type="text" name="MAKTX" style="width: 130px;"/>-->
<!--                            </li>-->
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
<!--                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="PRO_LIST_PRDLIST:PRO_LIST_PRDLIST:add">-->
<!--                    <i class="fa fa-plus"></i> 添加-->
<!--                </a>-->
<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="PRO_LIST_PRDLIST:PRO_LIST_PRDLIST:edit">-->
<!--                    <i class="fa fa-edit"></i> 修改-->
<!--                </a>-->
<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="PRO_LIST_PRDLIST:PRO_LIST_PRDLIST:remove">-->
<!--                    <i class="fa fa-remove"></i> 删除-->
<!--                </a>-->
                <a class="btn btn-warning" onclick="$.table.exportExcel()">
                    <i class="fa fa-download"></i> 导出
                </a>
                <a class="btn btn-info" onclick="getInstock()">
                    <i class="fa fa-upload"></i> 手动获取单据
                </a>
            </div>
            <div id="div" class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('PRO_LIST_PRDLIST:PRO_LIST_PRDLIST:edit')}]];
        var removeFlag = [[${@permission.hasPermi('PRO_LIST_PRDLIST:PRO_LIST_PRDLIST:remove')}]];
        var zflgEnchgDatas = [[${@dict.getType('ZFLG_ENCHG')}]];
        var zflgGet01Datas = [[${@dict.getType('ZFLG_GET01')}]];
        var prefix = ctx + "PRO_LIST_PRDLIST/PRO_LIST_PRDLIST";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                height: $("#div").height() / 1,
                modalName: "生产原始数据",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'mandt',
                    title: '客户端',
                    visible: false

                },
                {
                    field: 'aufnr',
                    title: '内部订单'
                },
                {
                    field: 'auart',
                    title: '订单类型'
                },
                {
                    field: 'fevor',
                    title: '生产调度员',
                    visible: false
                },
                {
                    field: 'verid',
                    title: '生产版本',
                    visible: false
                },
                {
                    field: 'werks',
                    title: '工厂'
                },
                {
                    field: 'matnr',
                    title: '物料号'
                },
                {
                    field: 'maktx',
                    title: '物料描述',
                    visible: false
                },
                {
                    field: 'psmng',
                    title: '订单项数量'
                },
                {
                    field: 'meins',
                    title: '自制生产的计量单位',
                    visible: false
                },
                {
                    field: 'gltrp',
                    title: '基本完成日期'
                },
                {
                    field: 'gstrp',
                    title: '基本开始日期'
                },
                {
                    field: 'kdauf',
                    title: '销售订单数'
                },
                {
                    field: 'kdpos',
                    title: '销售订单中的项目编号'
                },
                {
                    field: 'bstzd',
                    title: '大订单',
                    visible: false
                },
                {
                    field: 'ysoart01',
                    title: '销售订单类型'
                },
                {
                    field: 'yvbeln_C',
                    title: '客户销售订单',
                    visible: false
                },
                {
                    field: 'yposnr_C',
                    title: '客户销售订单行'
                },
                {
                    field: 'ysoart_C',
                    title: '客户销售订单类型',
                    visible: false
                },
                {
                    field: 'kummr',
                    title: '客户编号1',
                    visible: false
                },
                {
                    field: 'name1',
                    title: '客户名称'
                },
                {
                    field: 'bstkd',
                    title: '客户采购订单编号'
                },
                {
                    field: 'bstkd_E',
                    title: '运达方的采购订单编号',
                    visible: false
                },
                {
                    field: 'zstreet',
                    title: '街道',
                    visible: false
                },
                {
                    field: 'kdmat',
                    title: '客户物料',
                    visible: false
                },
                {
                    field: 'yamtxt_En',
                    title: '补件的英文描述',
                    visible: false
                },
                {
                    field: 'zkunnr_We',
                    title: '送达方代码',
                    visible: false
                },
                {
                    field: 'zkname_We',
                    title: '送达方名称',
                    visible: false
                },
                {
                    field: 'country',
                    title: '国家代码',
                    visible: false
                },
                {
                    field: 'region',
                    title: '地区',
                    visible: false
                },
                {
                    field: 'zregion_TXT',
                    title: '地区描述',
                    visible: false
                },
                {
                    field: 'zflg_EnCHG',
                    title: '允许变更标志',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(zflgEnchgDatas, value);
                    },
                    visible: false
                },
                {
                    field: 'ykuan1',
                    title: '物料组2',
                    visible: false
                },
                {
                    field: 'ykutxt',
                    title: '款式描述',
                    visible: false
                },
                {
                    field: 'zck_YSCZYX',
                    title: '颜色材质压线特性',
                    visible: false
                },
                {
                    field: 'zck_YSCZYX_TXT',
                    title: '颜色材质压线特性描述',
                    visible: false
                },
                {
                    field: 'zck_YSCZYX_TXT_E',
                    title: '颜色材质压线特性英文描述',
                    visible: false
                },
                {
                    field: 'zck_FHTX',
                    title: '防火特性',
                    visible: false
                },
                {
                    field: 'zck_FHTX_TXT',
                    title: '防火特性描述',
                    visible: false
                },
                {
                    field: 'zck_TJ',
                    title: '铁铰特性',
                    visible: false
                },
                {
                    field: 'zck_TJ_TXT',
                    title: '铁铰特性描述',
                    visible: false
                },
                {
                    field: 'zck_XD',
                    title: '消毒特性',
                    visible: false
                },
                {
                    field: 'zck_XD_TXT',
                    title: '消毒特性描述',
                    visible: false
                },
                {
                    field: 'zck_CT',
                    title: '插头线特性',
                    visible: false
                },
                {
                    field: 'zck_CT_TXT',
                    title: '插头线特性描述',
                    visible: false
                },
                {
                    field: 'zck_MT',
                    title: '客户唛头特性',
                    visible: false
                },
                {
                    field: 'zck_MT_TXT',
                    title: '客户唛头特性描述',
                    visible: false
                },
                {
                    field: 'zck_LB',
                    title: '产品类别特性',
                    visible: false
                },
                {
                    field: 'zck_LB_TXT',
                    title: '产品类别特性描述',
                    visible: false
                },
                {
                    field: 'zck_GN',
                    title: '功能非功能特性',
                    visible: false
                },
                {
                    field: 'zck_GN_TXT',
                    title: '功能非功能特性描述',
                    visible: false
                },
                {
                    field: 'zck_MF',
                    title: '木方特性',
                    visible: false
                },
                {
                    field: 'zck_MF_TXT',
                    title: '木方特性描述',
                    visible: false
                },
                {
                    field: 'zck_TZDJ',
                    title: '头枕电机特性',
                    visible: false
                },
                {
                    field: 'zck_TZDJ_TXT',
                    title: '头枕电机特性描述',
                    visible: false
                },
                {
                    field: 'zwrildt',
                    title: '最近写入日期',
                    visible: false
                },
                {
                    field: 'zwriltm',
                    title: '最近写入时间最近写入者',
                    visible: false
                },
                {
                    field: 'zwriusr',
                    title: '已取数标识',
                    visible: false
                },
                {
                    field: 'zflg_GET01',
                    title: '已取数标识',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(zflgGet01Datas, value);
                    },
                    visible: false
                },
                {
                    field: 'zgetldt',
                    title: '最近取数日',
                    visible: false
                },
                {
                    field: 'zgetltm',
                    title: '最近取数时间',
                    visible: false
                },
                {
                    field: 'zgetusr',
                    title: '最近取数者',
                    visible: false
                },
                {
                    field: 'wempf',
                    title: '收货方/运达方',
                    visible: false
                },
                {
                    field: 'zcndl',
                    title: '产能当量'
                },
                {
                    field: 'strwg',
                    title: '',
                    visible: false
                },
                {
                    field: 'txtgn',
                    title: '款式描述'
                },
                {
                    field: 'vdatu',
                    title: '请求交货日期'
                },
                {
                    field: 'vkbur',
                    title: '销售部门',
                    visible: false
                },
                {
                    field: 'gamng',
                    title: '订单数量总计'
                },
                {
                    field: 'meinh',
                    title: '作业/工序的计量单位',
                    visible: false
                },
                {
                    field: 'txt',
                    title: '生产调度员描述',
                    visible: false
                },
                {
                    field: 'objid',
                    title: '对象标识',
                    visible: false
                },
                {
                    field: 'zplnt',
                    title: '分厂'
                },
                {
                    field: 'sobkz',
                    title: '特殊库存标识',
                    visible: false
                },
                // {
                //     title: '操作',
                //     align: 'center',
                //     formatter: function(value, row, index) {
                //         var actions = [];
                //         actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.MANDT + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                //         actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.MANDT + '\')"><i class="fa fa-remove"></i>删除</a>');
                //         return actions.join('');
                //     }
                // }
                ]
            };
            $.table.init(options);
        });
        function getInstock() {
            var aufnr = document.getElementById("AUFNR").value;
            $.ajax({
                "url": "/timer/getProduceOrderOne?AUFNR="+aufnr,
                "type": "GET",
                "dataType": "json",
                "success": function (result) {
                    $.modal.alert(result.msg)
                }
            });

        }
    </script>
</body>
</html>